/****************************************************
	文件：ResLoadResult.cs
	作者：HuskyT
	邮箱：1005240602@qq.com
	日期：2021/1/2 0:0:37
	功能：资源加载结果
*****************************************************/

using HTFW.Core;

namespace HTFW.Res
{
    public class ResLoadResult : ILoadResult
    {
        IResultRecord mRecord;

        public bool IsDone
        {
            get { return mRecord.CurCnt >= mRecord.TotalCnt; }
        }

        public float Progress
        {
            get { return mRecord.CurCnt / mRecord.TotalCnt * 1f; }
        }

        public int ObjectPoolIndex { get; set; }

        public void Dispose()
        {
            mRecord = null;
        }

        public void Init(IResultRecord record)
        {
            mRecord = record;
            record.AsyncResult = this;
        }
    }
}